package com.itany.corejava.code08_常用类.其他类;

import com.itany.corejava.util.DateUtil;

import java.util.Calendar;
import java.util.Scanner;

/**
 * @author 石小俊
 * @version 1.0
 * @date 2023年03月17日 15:07
 */
public class Test02_练习 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入年份:");
        int year = sc.nextInt();
        System.out.print("请输入月份:");
        int month = sc.nextInt();
        Calendar calendar = Calendar.getInstance();
        // 方式一
        int day = DateUtil.getDay(year,month);
        System.out.println(year + "年" + month + "月共有" + day + "天");

        // 方式二
        day = DateUtil.getDay2(year,month);
        System.out.println(year + "年" + month + "月共有" + day + "天");
    }
}
